package plugins;

import interfaces.Board;
import interfaces.Cell;
import interfaces.Command;


/** 
 * The command that makes the cell die
 */
public class DieCommand extends Command {

	/** 
	 * Calls the Command constructor
	 * @param c - the cell that will be changed to dead
	 */
	public DieCommand(Cell c){
		super(c);
	}
	
	/** 
	 * Executes the die command - the cell changes is now dead
	 *  
	 *  @param b - the board that is changed
	 *  @throws IllegalArgumentException if automaton or b is null.
	 */
	public void execute(Board b) {
		if(c == null)
			throw new IllegalArgumentException("Cell cannot be null");
		if(b == null)
			throw new IllegalArgumentException("Board cannot be null");
		((ConwayCell) c).die();
	}

}
